﻿using IOCPExampleProtocol;
using System;
using PNet;
namespace IOCPClientExample
{
    public class ClientStart
    {
        static void Main(string[] args)
        {
            IOCPNet<ClientToken,NetMsg> client = new IOCPNet<ClientToken, NetMsg> ();
            client.StartAsClient("127.0.0.1", 17688);
            while (true) 
            {
                string inputStr = Console.ReadLine();
                if (inputStr == "quit")
                {
                    client.CloseClient();
                    break;
                }
                else
                {
                    client.Token.SendMsg(new NetMsg() { Msg = inputStr });
                }
            }



            Console.ReadKey();
        }
    }
}
